home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / EMPTYSET.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  782b  |  53 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8.         extrn    sl_malloc:far
  9. ;
  10. ; EmptySet-    Clears an existing set's elements changing it to the empty
  11. ;        set.
  12. ;
  13. ;        ES:DI must point at set (first byte of desired set) upon
  14. ;        entry.
  15. ;
  16. ;
  17.         public    sl_EmptySet
  18. ;
  19. sl_EmptySet    proc    far
  20.         push    ds
  21.         push    ax
  22.         push    cx
  23.         pushf
  24.         push    di
  25.         push    si
  26. ;
  27.         mov    ax, es
  28.         mov    ds, ax
  29.         mov    ah, [di]        ;Get Mask byte.
  30.         not    ah
  31.         add    di, 8            ;Point at start of set
  32.         mov    si, di
  33.         mov    cx, 256
  34. ClearSet:    lodsb
  35.         and    al, ah
  36.         stosb
  37.         loop    ClearSet
  38. ;
  39.         pop    si
  40.         pop    di
  41.         popf
  42.                 pop    cx
  43.         pop    ax
  44.         pop    ds
  45.         clc
  46.         ret
  47. ;
  48. sl_EmptySet    endp
  49. ;
  50. ;
  51. stdlib        ends
  52.         end
  53.